<template>
  <div class="row">
    <div class="col">
      <createdactivityVue v-bind="{ ID: Number(route.query.ID), isAdmin: true }"
        :createdorupdateactivtiy="createdorupdateactivtiy" :routers="{ name: '比赛管理' }"></createdactivityVue>
    </div>
  </div>
</template>
<script setup lang="ts">
import { inject } from "vue";
import { useRoute } from "vue-router";
import {
  asynccreateorupdateactivity,
} from "../../../api/index";
import createdactivityVue from '../../../components/activity/createdactivity.vue';
import Studycodemodel from '../../../mysql_interface/studycodemodel';

// 码客行
const tenant_id = inject<string | undefined>('tenant_id', undefined)

async function createdorupdateactivtiy(data: {
  data: Studycodemodel.Iactivity;
  question: Studycodemodel.Imatchquestion[];
  teamid?: number | undefined;
  users: Studycodemodel.Iuser[]
}) {
  data.data = { ...data.data, tenant_id }
  return asynccreateorupdateactivity({ ...data, tenant_id })
}


const route = useRoute()

</script>
